<?php

    $rawData = $_POST['imgBase64'];
    $filteredData = explode(',', $rawData);
    $unencoded = base64_decode($filteredData[1]);

    $fp = fopen('../png/image.png', 'w');
    fwrite($fp, $unencoded);
    fclose($fp);

    $result = shell_exec('/home/www/png/sample.sh');
    echo $result;
?>
